﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AoYing_DeviceCollection.Model
{
    public class DesignJson
    {
        /// <summary>
        /// 
        /// </summary>
        public List<Cells> cells { get; set; }
    }
    public class Cells
    {
        /// <summary>
        /// 类型 start process processGroup end
        /// </summary>
        public string shape { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string id { get; set; }
        /// <summary>
        /// 属性
        /// </summary>
        public Data data { get; set; }
        /// <summary>
        /// 元素的进出线
        /// </summary>
        //public Ports ports { get; set; }
        /// <summary>
        /// 来自
        /// </summary>
        public Source source { get; set; }
        /// <summary>
        /// 目标
        /// </summary>
        public Target target { get; set; }
    }
    public class Data
    {
        // 描述
        public string description { get; set; }
        // 工序名
        public string name { get; set; }
        // GXCode
        public string type { get; set; } = string.Empty;
        // 设备ID
        public string machid { get; set; } = string.Empty;
        // 必过工位
        public bool isMust { get; set; } = false;
        // 关键工位
        public bool isPrimary { get; set; } = false;
        // 老化工位
        public bool isAgeing { get; set; } = false;
        // 测试工位
        public bool isTest { get; set; } = false;
        // 是否装箱
        public bool isInBox { get; set; } = false;
        // 投入打标签
        public bool startprintcode { get; set; } = false;
        // 过站重打标签
        public bool reprintcode { get; set; } = false;
        // 是否Link
        public bool isLink { get; set; } = false;
        // 是否注册
        public bool isRegister { get; set; } = false;
        // 重复过站
        public bool isRepeat { get; set; } = false;
        // 拼板过站
        public string isGroup { get; set; } = string.Empty;
        // 允许返工
        public string isRework { get; set; } = string.Empty;
        // 验证工单备注
        public string checkwocderemark { get; set; } = string.Empty;
        // 验证工单SN
        public string checkzcwocodesn { get; set; } = string.Empty;

        // 自定义箱码
        public string isdefineboxno { get; set; } = string.Empty;

        // 箱码分割符
        public string splitstr { get; set; } = string.Empty;

        //*************** 额外属性 *******************//
        // 老化时间，单位分钟，当 isAgeing = true 时显示
        public float? ageingTime { get; set; }
        // 老化自动出站，当 isAgeing = true 时显示，默认false
        public bool isAgeingAuto { get; set; } = false;

        // 关键物料，取 sysdatmaterial 表的mateid 多选，当 isPrimary = true 时显示
        public List<string> primaryMateList { get; set; } = new List<string>();

        // 关键物料
        public List<string> linklist { get; set; } = new List<string>();

        // 测试方式  人工输入、范围内随机输入、设备采集
        public string testType { get; set; }

        /// <summary>
        /// SN规则
        /// </summary>
        public string regStr { get; set; }

        /// <summary>
        /// 测试属性
        /// </summary>
        public List<SelectItem> selectItem { get; set; } = new List<SelectItem>();

        /// <summary>
        /// 老化测试属性
        /// </summary>
        public List<SelectItem> ageingList { get; set; } = new List<SelectItem>();

        /// <summary>
        /// 验证工序
        /// </summary>
        public List<string> checknodes = new List<string>();

        /// <summary>
        /// 验证表
        /// </summary>
        public string tablename { get; set; }

        /// <summary>
        /// SN字段
        /// </summary>
        public string sncolumnsid { get; set; }

        /// <summary>
        /// 验证字段
        /// </summary>
        public string columnsid { get; set; }

        /// <summary>
        /// 验证值
        /// </summary>
        public string result { get; set; }


    }
    public class Source
    {
        /// <summary>
        /// 
        /// </summary>
        public string cell { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string port { get; set; }
    }

    public class Target
    {
        /// <summary>
        /// 
        /// </summary>
        public string cell { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string port { get; set; }
    }
    public class SelectItem
    {
        /// <summary>
        /// 测试key
        /// </summary>
        public string key { get; set; }
        /// <summary>
        /// 测试标题
        /// </summary>
        public string title { get; set; }

        /// <summary>
        /// 测试最大值
        /// </summary>
        public float maxvalue { get; set; }
        /// <summary>
        /// 测试最小值
        /// </summary>
        public float minvalue { get; set; }
        /// <summary>
        /// 测试值
        /// </summary>
        public string value { get; set; }
    }
}
